var url = require('url');
var template = require('templateConfig');
var main = require('main');
var form = require('form');
var module = require('module');
//模板配置
var tplArr = [];
var modalTpl =require('raw!../template/modal.txt'); 
var fansTpl =require('raw!../template/fans-move.txt'); 
tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));
tplArr['fans'] = template.compile(fansTpl.replace(/^\s*|\s*$/g, "")); 
 
function Fans(){
    _this = this;
    this.main = function(){
        main.event(this,'tap','i-click'); 
        this.init();
    }     
    this.getContent = function(){
    	var data={
    		tType:'content',
    		dataList:[{
    			number: "1029930",
	    		status: "已迁移",
	    		store: "福建中路店",
	    		level: "店员",
	    		name: "小薇",
	    		fans: "235",
	    		jsstore: "福建中路店",
	    		method: "等比例迁移"
    		},{
    			number: "1095532",
	    		status: "未迁移",
	    		store: "福建中路店",
	    		level: "店员",
	    		name: "小薇",
	    		fans: "235",
	    		jsstore: "福建中路店",
	    		method: "等比例迁移"
    		}]
    	}
    	$(".content").html(tplArr['fans'](data));
    }
    this.addMove = function(){
    	var data = {
            tType: "addMove",
        }
        main.botActionsheet({"content":tplArr['fans'](data)});
    }
    this.Detail =function(){
        var detail = {
            tType:"detail",
            detailList:[{
               name: "小薇",
                value: "3%", 
            },{
               name: "小刘",
                value: "2%", 
            }]
            
        }
        var data = {
            tType: "addMove",
            detail: tplArr['fans'](detail)
        }
        main.botActionsheet({"content":tplArr['fans'](data)});
    }
    this.init= function(){ 
        this.getContent();     
    }
    return this.main();
};

var fans = new Fans();